package com.project.mapper;

import com.project.bean.RoomBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface IRoomMapper {
    @Insert("INSERT INTO t_room(r_address,r_price,r_createDate)VALUES(#{address},#{price},#{createDate})")
    public void add(RoomBean room);
    @Delete("delete from t_room where pk_roonId=#{id}")
    public void del(int id);
    @Update("update t_room set r_price=#{price} where pk_roonId=#{id}")
    public void update(@Param("id") int id,@Param("price") int price);
    @Select("select * from t_room where pk_roonId=#{id}")
    @ResultMap("roomMap")
    public RoomBean findById(int id);
    public List<RoomBean> findByItem(@Param("address") String address,
           @Param("startPrice") Integer startPrice, @Param("endPrice") Integer endPrice);
}
